home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_caveamb.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  98 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHW_CaveAmb.cog
  4. #
  5. # Produces random ambient cave sounds when attatched to a ghost object.
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC]  modified 12/3 by [CMG]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     crossed
  16.     message     pulse
  17.     
  18.     surface       oncross               linkID=2
  19.     surface       oncross1              linkID=2
  20.     surface       offcross              linkID=3
  21.     surface       offcross1             linkID=3
  22.     
  23.             
  24.     sound       sndCave0=shw_amb2.wav    local
  25.     sound       sndCave1=shw_amb3.wav    local
  26.     sound       sndCave2=shw_amb4.wav    local
  27.     sound       sndCave3=shw_amb5.wav    local
  28.     sound       sndCave4=shw_amb6.wav    local
  29.     sound       sndCave5=shw_amb7.wav    local
  30.         
  31.     float       caveFreq        local
  32.     
  33.     flex        pulseTime=4.0
  34.     flex        vol=1.0
  35.     
  36. end
  37.  
  38. # ========================================================================================
  39.  
  40. code
  41.  
  42. crossed:
  43.  
  44.     If (GetSenderID() == 2)
  45.             {
  46.             SetPulse(pulseTime);
  47.             print("starting  sound");
  48.             }
  49.     
  50.     If (GetSenderID() == 3)
  51.             {
  52.             SetPulse(0);
  53.             print("shutting off sound");
  54.             }
  55.  
  56. return;
  57. # ========================================================================================
  58.  
  59. pulse:
  60.     
  61.     caveFreq = Rand();
  62.  
  63.     if (caveFreq < 0.16)
  64.         {
  65.             PlaySoundLocal(sndCave0, vol, 1, 0, 0);
  66.         }
  67.         
  68.     if ((caveFreq > 0.16) && (caveFreq < 0.32))
  69.         {
  70.             PlaySoundLocal(sndCave1, vol, 0, 0, 0);
  71.         }
  72.         
  73.     if ((caveFreq > 0.32) && (caveFreq < 0.48))
  74.         {
  75.             PlaySoundLocal(sndCave2, vol, -1, 0, 0);
  76.         }
  77.     
  78.     if ((caveFreq > 0.48) && (caveFreq < 0.64))
  79.         {
  80.             PlaySoundLocal(sndCave3, vol, 1, 0, 0);
  81.         }
  82.     
  83.     if ((caveFreq > 0.64) && (caveFreq < 0.80))
  84.         {
  85.             PlaySoundLocal(sndCave4, vol, 0, 0, 0);
  86.         }
  87.     
  88.     if ((caveFreq > 0.80) && (caveFreq < 0.96))
  89.         {
  90.             PlaySoundLocal(sndCave5, vol, -1, 0, 0);
  91.         }
  92.         
  93.     return;
  94.     
  95. # ========================================================================================
  96.         
  97. end
  98.